import request, { IResposeItem } from "@/configs/request"
import { to } from "@/utils"

// 系统设置
export interface IQuqeyBasePage {
  current: number
  size: any
}

/**
    科室列表  
 */
export interface sysDeptListInpam extends IQuqeyBasePage {
  deptName?: string
  [propName: string]: any
}
export interface sysDeptListOutRecord {
  id: string;
  name: string;
  code: any;
  deptParentId: number;
  deptType: number;
  deptTypeDes: string;
  deptParentName: string;
  createTime: string;
  hospitalName: string;
  [propName: string]: any
}

export interface sysDeptListOut {
  records: sysDeptListOutRecord[];
  total: number;
  size: number;
  current: number;
  orders: any[];
  optimizeCountSql: boolean;
  hitCount: boolean;
  countId: any;
  maxLimit: any;
  searchCount: boolean;
  pages: number;
  [propName: string]: any
}
export const sysDeptListApi = (parmas: sysDeptListInpam): Promise<[any, IResposeItem<sysDeptListOut>]> => {
  return to<IResposeItem<sysDeptListOut>>(request.post("/sys/sysDept/list", parmas))
}




/**
    角色列表  
 */
export interface sysRoleListInpam extends IQuqeyBasePage {
  roleName?: string
  [propName: string]: any
}
export interface sysDeptListRecord {
  id: string;
  roleName: string;
  roleCode: string;
  status: number;
  statusRes: string;
  remark: string;
  createTime: string;
  [propName: string]: any
}

export interface sysRoleListOut {
  records: sysDeptListRecord[];
  total: number;
  size: number;
  current: number;
  orders: any[];
  optimizeCountSql: boolean;
  hitCount: boolean;
  countId?: any;
  maxLimit?: any;
  searchCount: boolean;
  pages: number;
  [propName: string]: any
}
export const sysRoleListApi = (parmas: sysRoleListInpam): Promise<[any, IResposeItem<sysRoleListOut>]> => {
  return to<IResposeItem<sysRoleListOut>>(request.post("/sys/sysRole/list", parmas))
}



/**
    用户列表  
 */
export interface userListInpam extends IQuqeyBasePage {
  roleName?: string
  type?: number
  typeId?: number
  [propName: string]: any
}
export interface userListRecord {
  id: string;
  name: string;
  roleId: string;
  roleName: string;
  deptId: number;
  deptName: string;
  hospitalId: number;
  hospitalName: string;
  jobTitleId: any;
  jobTitleName: any;
  status: number;
  statusDsc: string;
  createTime: string;
  [propName: string]: any
}

export interface userListOut {
  records: userListRecord[];
  total: number;
  size: number;
  current: number;
  orders: any[];
  optimizeCountSql: boolean;
  hitCount: boolean;
  countId: any;
  maxLimit: any;
  searchCount: boolean;
  pages: number;
  [propName: string]: any
}
export const userListApi = (parmas: userListInpam): Promise<[any, IResposeItem<userListOut>]> => {
  return to<IResposeItem<userListOut>>(request.post("/sys/user/list", parmas))
}